13. What is a vector?

What is a vector? Physics versus Computer Programming

You might have learned at some point that a vector is a measurement or quantity that has both a magnitude and a direction. Examples might be distance along a y-axis or velocity towards the north-west.

But in computer programming, when we say "vector" we are just referring a list of values.

These two ways of thinking about vectors are actually deeply related, but for this Nanodegree we're going to look at vectors from a computer science point of view.

Vectors, Motion Models and Kalman Filters in Self-Driving Cars

In a physics class, you might have one vector for position and then a separate vector for velocity. But in computer programming, a vector is really just a list of values.

When using the Kalman filter equations, the bold, lower-case variable \mathbf{x} represents a vector in the computer programming sense of the word. The \mathbf{x} vector holds the values that represent your motion model such as position and velocity.

In a basic motion model, the vector \mathbf{x} will contain information about position and linear velocity like: \mathbf{x} = [x, y, v_x, v_y]. In a physics class, these might be represented with two different vectors: a position vector and a velocity vector.

A more complex motion model might take into account yaw rate, which considers a rotational angle and angular velocity around the center of the vehicle like \mathbf{x} = [x, y, v_x, v_y, \psi, \dot{\psi}].

So in order to use the Kalman filter equations and execute object tracking, you have to be familiar with vectors and how to write programs with them.